import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-04-18
 * Time: 8:46
 */
public class Demo4 {
    public static void main(String[] args) throws IOException {
        File f1= new File("./bbb.text");
        f1.createNewFile();
        System.out.println(f1.getCanonicalPath());

        File dir=new File("./testDemo/b.text");
        dir.mkdir();

        f1.renameTo(dir);//改名失败.不能将文件名改为目录名
        System.out.println(f1.getCanonicalPath());


    }
}
